Skip to content

[SPARK-58297][PYTHON] Remove TransformWithStateInPySparkRowSerializer#57470

Closed
Yicong-Huang wants to merge 1 commit into
apache:masterfrom
Yicong-Huang:SPARK-58297
Closed

[SPARK-58297][PYTHON] Remove TransformWithStateInPySparkRowSerializer#57470
Yicong-Huang wants to merge 1 commit into
apache:masterfrom
Yicong-Huang:SPARK-58297

Conversation

@Yicong-Huang

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Delete TransformWithStateInPySparkRowSerializer from python/pyspark/sql/pandas/serializers.py. Its row-by-row deserialization and re-encoding logic was moved into read_udfs() in worker.py by SPARK-58191 (#57337), which switched SQL_TRANSFORM_WITH_STATE_PYTHON_ROW_UDF to use the plain ArrowStreamSerializer for pure Arrow stream I/O. The class is no longer referenced by any eval type. The now-unused itertools.groupby and pyspark.sql.Row imports it required are also removed, and two benchmark comments in bench_eval_type.py that attributed the row walk to this class are updated to point at the worker.

Part of SPARK-55384.

Why are the changes needed?

The class is dead code after the refactor in SPARK-58191. Removing it keeps serializers as pure I/O and avoids a stale, unused class.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing tests. This is a dead-code deletion with no remaining references (verified repo-wide, including dynamic lookups); behavior is unchanged since the eval type already runs through read_udfs().

Was this patch authored or co-authored using generative AI tooling?

No.

Yicong-Huang added a commit that referenced this pull request Jul 24, 2026
### What changes were proposed in this pull request?

Delete `TransformWithStateInPySparkRowSerializer` from `python/pyspark/sql/pandas/serializers.py`. Its row-by-row deserialization and re-encoding logic was moved into `read_udfs()` in `worker.py` by [SPARK-58191](https://issues.apache.org/jira/browse/SPARK-58191) (#57337), which switched `SQL_TRANSFORM_WITH_STATE_PYTHON_ROW_UDF` to use the plain `ArrowStreamSerializer` for pure Arrow stream I/O. The class is no longer referenced by any eval type. The now-unused `itertools.groupby` and `pyspark.sql.Row` imports it required are also removed, and two benchmark comments in `bench_eval_type.py` that attributed the row walk to this class are updated to point at the worker.

Part of [SPARK-55384](https://issues.apache.org/jira/browse/SPARK-55384).

### Why are the changes needed?

The class is dead code after the refactor in SPARK-58191. Removing it keeps serializers as pure I/O and avoids a stale, unused class.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing tests. This is a dead-code deletion with no remaining references (verified repo-wide, including dynamic lookups); behavior is unchanged since the eval type already runs through `read_udfs()`.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #57470 from Yicong-Huang/SPARK-58297.

Authored-by: Yicong Huang <17627829+Yicong-Huang@users.noreply.github.com>
Signed-off-by: Yicong-Huang <17627829+Yicong-Huang@users.noreply.github.com>
(cherry picked from commit fd3d03c)
Signed-off-by: Yicong-Huang <17627829+Yicong-Huang@users.noreply.github.com>
@Yicong-Huang

Copy link
Copy Markdown
Contributor Author

Merge Summary:

Posted by merge_spark_pr.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants